home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cenviw1.zip / DOSTIME.CMM < prev    next >
Text File  |  1993-07-02  |  1KB  |  35 lines

  1. /***********************************************************************
  2.  *** DosTime - CEnvi example program for showing the Dos system time ***
  3.  ***********************************************************************/
  4.  
  5. #include "WinUtil.lib"
  6.  
  7. // give minimum screen size because time takes up little room
  8. ScreenSize(12,1);
  9.  
  10. // force screen to show, just so we can then resize and move it
  11. putchar(' ');
  12.  
  13. // move this small window to the very bottom-right corner of the screen
  14. WinBox = GetWindowRect(ScreenHandle());
  15. WinWidth = WinBox.right - WinBox.left + 1;
  16. WinHeight = WinBox.bottom - WinBox.top + 1;
  17. TotalWidth = GetSystemMetrics(SM_CXSCREEN);
  18. TotalHeight = GetSystemMetrics(SM_CYSCREEN);
  19.  
  20. MoveWindow(ScreenHandle(),             // handle for our text window
  21.            TotalWidth - (WinWidth * 8 / 12),      // against right edge of screen so only numbers show
  22.            TotalHeight - WinHeight,    // against bottom of screen
  23.            WinWidth,WinHeight,         // keep width and height the same
  24.            True);                      // redraw
  25.  
  26.  
  27. // print the time once per second and hang out here until a key is pressed
  28. while( !kbhit() ) {
  29.    reg.ah = 0x2C
  30.    interrupt(0x21,reg)
  31.    printf("\r%2d:%02d:%02d",reg.ch,reg.cl,reg.dh)
  32.    Suspend(1000);
  33. }
  34.  
  35.